package com.yuanfeng.business.controller;

import com.yuanfeng.business.dto.ManageActivityGoodsAddDTO;
import com.yuanfeng.business.dto.ShopRecordDTO;
import com.yuanfeng.business.dto.ShopRegistrationDTO;
import com.yuanfeng.business.dto.UserTokenBeanDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ShopRegistrationController
 * @Description
 * @Author hyq
 * @Date 2023/7/10 10:29
 * @Version 1.0
 **/
@RestController
@RequestMapping("/shop/registration")
public class ShopRegistrationController extends BaseController{

    /*
     * 新增专区报名活动
     */
    @PostMapping("/insertShopRegistration")
    public ResponseResult insertShopRegistration(@RequestBody(required = false) ShopRegistrationDTO param) {
        ResponseResult result=shopRegistrationService.insertShopRegistration(param);
        return result;
    }

    /**
     * 编辑商家专区报名活动
     * @param param
     * @return
     */
    @PostMapping("/updateShopRegistration")
    public ResponseResult updateShopRegistration(@RequestBody(required = false) ShopRegistrationDTO param) {
        ResponseResult result=shopRegistrationService.updateShopRegistration(param);
        return result;
    }

    /**
     * 查询专区详情
     * @param param
     * @return
     */
    @PostMapping("/queryShopRegistration")
    public ResponseResult queryShopRegistration(@RequestBody(required = false) ShopRegistrationDTO param) {
        ResponseResult result=shopRegistrationService.queryShopRegistration(param);
        return result;
    }

    /**
     * 删除商家专区报名活动
     * @param param
     * @return
     */
    @PostMapping("/deleteShopRegistration")
    public ResponseResult deleteShopRegistration(@RequestBody(required = false) ShopRegistrationDTO param) {
        ResponseResult result=shopRegistrationService.deleteShopRegistration(param);
        return result;
    }

    /*
     * 查询专区活动列表
     */
    @PostMapping("/selectShopRegistration")
    public ResponseResult selectShopRegistration(@RequestBody(required = false) ShopRegistrationDTO param) throws IllegalAccessException {
        ResponseResult result=shopRegistrationService.selectShopRegistration(param);
        return result;
    }

    /**
     * @title queryActiveName
     * @description 获取商家可以参与的专区
     * @author s lj
     * @updateTime 2021/8/11 14:07
     * @throws
     */
    @PostMapping("/queryActiveName")
    public ResponseResult queryActiveName(@RequestBody UserTokenBeanDTO param){
        ResponseResult result=shopRegistrationService.queryActiveName(param);
        return result;
    }

    /**
     * 增加商品到活动专区
     *
     * @param param
     * @return
     */
    @PostMapping("/goods/add")
    public ResponseResult addActivityGoods(@RequestBody ManageActivityGoodsAddDTO param) {
        ResponseResult result=shopRegistrationService.addActivityGoods(param);
        return result;
    }

    /**
     * 查询新增版本信息
     * @return
     */
    @PostMapping("/selectNewVersion")
    public ResponseResult selectNewVersion() {
        return shopRegistrationService.selectNewVersion();
    }

    /**
     * 查询最新报名活动
     * @return
     */
    @PostMapping("/selectNewShopRegist")
    public ResponseResult selectNewShopRegist() {
        return shopRegistrationService.selectNewShopRegist();
    }

    /**
     * 我要参与 商家活动报名记录
     * @param param
     * @return
     */
    @PostMapping("/insertShopRecord")
    public ResponseResult insertShopRecord(@RequestBody ShopRecordDTO param){
        return shopRegistrationService.insertShopRecord(param);
    }
}
